<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!-- definition of simple types --> 
<xsd:simpleType name="languageType">
 <xsd:restriction base="xsd:string">
  <xsd:enumeration value="en"/>
  <xsd:enumeration value="es"/>
  <xsd:enumeration value="it"/>
  <xsd:enumeration value="nl"/>
 </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="non-empty-string">
 <xsd:restriction base="xsd:string">
  <xsd:minLength value="1" />
 </xsd:restriction>
</xsd:simpleType>

<xsd:element name="search" type="non-empty-string" />
<xsd:element name="replace" type="non-empty-string" />
<xsd:attribute name="from" type="languageType" />
<xsd:attribute name="to" type="languageType" />

<xsd:element name="wordEntry">
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element ref="search" />
   <xsd:element ref="replace" />
  </xsd:sequence>
 </xsd:complexType>
</xsd:element>

<xsd:element name="wordlist">
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element ref="wordEntry" minOccurs="0" maxOccurs="unbounded" />
  </xsd:sequence>
  <xsd:attribute ref="from" use="required" />
  <xsd:attribute ref="to" use="required" />
 </xsd:complexType>
</xsd:element>

</xsd:schema>
